import axios from "axios";
import qs from "query-string";

export default {
  /**
   * 导出电子签章pdf
   * @method
   * @name getSignPdf
   */
  getSignPdf: (params = {}) => {
    let domain = window.api.domain;
    let path = "/workflow/signature/pdf";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["ids"] !== undefined) {
      queryParameters["ids"] = params["ids"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 导出督办事项信息列表
   * @method
   * @name getSupervisionMatterExcel
   */
  getSupervisionMatterExcel: (params = {}) => {
    let domain = window.api.domain;
    let path = "/supervision/matter/excel";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["keywords"] !== undefined) {
      queryParameters["keywords"] = params["keywords"];
    }

    if (params["categoryId"] !== undefined) {
      queryParameters["categoryId"] = params["categoryId"];
    }

    if (params["startTime"] !== undefined) {
      queryParameters["startTime"] = params["startTime"];
    }

    if (params["endTime"] !== undefined) {
      queryParameters["endTime"] = params["endTime"];
    }

    if (params["reportKeywords"] !== undefined) {
      queryParameters["reportKeywords"] = params["reportKeywords"];
    }

    if (params["startReportTime"] !== undefined) {
      queryParameters["startReportTime"] = params["startReportTime"];
    }

    if (params["endReportTime"] !== undefined) {
      queryParameters["endReportTime"] = params["endReportTime"];
    }

    if (params["responsibleUser"] !== undefined) {
      queryParameters["responsibleUser"] = params["responsibleUser"];
    }

    if (params["leaderUser"] !== undefined) {
      queryParameters["leaderUser"] = params["leaderUser"];
    }

    if (params["mainLeader"] !== undefined) {
      queryParameters["mainLeader"] = params["mainLeader"];
    }

    if (params["status"] !== undefined) {
      queryParameters["status"] = params["status"];
    }

    if (params["matterId"] !== undefined) {
      queryParameters["matterId"] = params["matterId"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 栏目的文章数据excel导出
   * @method
   * @name deptDataCountExcelUsingPOST
   */
  deptDataCountExcelUsingPOST: (params = {}) => {
    let domain = window.api.domain;
    let path = "/api/home/deptDataCountExcel";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/octet-stream";
    headers["Content-Type"] = "application/json";

    if (params["appKey"] !== undefined) {
      headers["appKey"] = params["appKey"];
    }

    if (params["authorization"] !== undefined) {
      headers["Authorization"] = params["authorization"];
    }

    if (params["dataSearchDto"] !== undefined) {
      body = params["dataSearchDto"];
    }

    if (params["dataSearchDto"] === undefined) {
      return Promise.reject(
        new Error("Missing required  parameter: dataSearchDto")
      );
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }
    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 论坛主题统计导出（实时）
   * @method
   * @name plateRoleExcelUsingPOST_1
   */
  plateRoleExcelUsingPOST_1: (params = {}) => {
    let domain = window.api.domain;
    let path = "/theme/themeCountExcel";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/octet-stream";
    headers["Content-Type"] = "application/json";

    if (params["appKey"] !== undefined) {
      headers["appKey"] = params["appKey"];
    }

    if (params["authorization"] !== undefined) {
      headers["Authorization"] = params["authorization"];
    }

    if (params["baseSearchDto"] !== undefined) {
      body = params["baseSearchDto"];
    }

    if (params["baseSearchDto"] === undefined) {
      return Promise.reject(
        new Error("Missing required  parameter: baseSearchDto")
      );
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 主题月统计导出
   * @method
   * @name getThemeCountMonthExcelUsingPOST
   */
  getThemeCountMonthExcelUsingPOST: (params = {}) => {
    let domain = window.api.domain;
    let path = "/admin/themeCount/listByMonthExcel";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/octet-stream";
    headers["Content-Type"] = "application/json";

    if (params["appKey"] !== undefined) {
      headers["appKey"] = params["appKey"];
    }

    if (params["authorization"] !== undefined) {
      headers["Authorization"] = params["authorization"];
    }

    if (params["baseThemeCountSerachDto"] !== undefined) {
      body = params["baseThemeCountSerachDto"];
    }

    if (params["baseThemeCountSerachDto"] === undefined) {
      return Promise.reject(
        new Error("Missing required  parameter: baseThemeCountSerachDto")
      );
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 返回pdf流文件并打印
   * @method
   * @name getOfficialRegisterPdf
   */
  getOfficialRegisterPdf: (params = {}) => {
    let domain = window.api.domain;
    let path = "/official/register/pdf";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["ids"] !== undefined) {
      queryParameters["ids"] = params["ids"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 获取文件
   * @method
   * @name getFile
   */
  getFile: (params = {}, onDownloadProgress = null) => {
    let domain = window.api.fileApi ? window.api.fileApi : window.api.domain; // fgw文件正式
    let path = "/sys/file/{id}";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/octet-stream";

    path = path.replace("{id}", params["id"]);

    if (params["id"] === undefined) {
      return Promise.reject(new Error("Missing required  parameter: id"));
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer",
      onDownloadProgress: onDownloadProgress
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 通过文档来获取文件,id为文件id
   * @method
   * @name getDownloadFile
   */
  getDownloadFile: (params = {}) => {
    let domain = window.api.domain;
    let path = "/document/download/{id}";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/octet-stream";

    path = path.replace("{id}", params["id"]);

    if (params["id"] === undefined) {
      return Promise.reject(new Error("Missing required  parameter: id"));
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 根据查询条件导出来文登记列表
   * @method
   * @name getOfficialRegisterExcel
   */
  getOfficialRegisterExcel: (params = {}) => {
    let domain = window.api.domain;
    let path = "/official/register/excel";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["pageIndex"] !== undefined) {
      queryParameters["pageIndex"] = params["pageIndex"];
    }

    if (params["pageSize"] !== undefined) {
      queryParameters["pageSize"] = params["pageSize"];
    }

    if (params["handleDeptName"] !== undefined) {
      queryParameters["handleDeptName"] = params["handleDeptName"];
    }

    if (params["originalOfficialNumber"] !== undefined) {
      queryParameters["originalOfficialNumber"] =
        params["originalOfficialNumber"];
    }

    if (params["title"] !== undefined) {
      queryParameters["title"] = params["title"];
    }

    if (params["status"] !== undefined) {
      queryParameters["status"] = params["status"];
    }

    if (params["isWrong"] !== undefined) {
      queryParameters["isWrong"] = params["isWrong"];
    }

    if (params["startTime"] !== undefined) {
      queryParameters["startTime"] = params["startTime"];
    }

    if (params["endTime"] !== undefined) {
      queryParameters["endTime"] = params["endTime"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 获取文件
   * @method
   * @name getSpecialFile
   */
  getSpecialFile: (params = {}, onDownloadProgress) => {
    let domain = window.api.fileApi ? window.api.fileApi : window.api.domain;
    let path = "/download/pdf/special/file/{id}";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    path = path.replace("{id}", params["id"]);

    if (params["id"] === undefined) {
      return Promise.reject(new Error("Missing required  parameter: id"));
    }

    if (params["waterMark"] !== undefined) {
      queryParameters["waterMark"] = params["waterMark"];
    }

    if (params["waterText"] !== undefined) {
      queryParameters["waterText"] = params["waterText"];
    }

    if (params["isLabel"] !== undefined) {
      queryParameters["isLabel"] = params["isLabel"];
    }

    if (params["labelText"] !== undefined) {
      queryParameters["labelText"] = params["labelText"];
    }

    if (params["labelX"] !== undefined) {
      queryParameters["labelX"] = params["labelX"];
    }

    if (params["labelY"] !== undefined) {
      queryParameters["labelY"] = params["labelY"];
    }

    if (params["taskId"] !== undefined) {
      queryParameters["taskId"] = params["taskId"];
    }
    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer",
      onDownloadProgress: onDownloadProgress
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },

  /**
   * 根据实例ID或任务ID下载表单PDF
   * @method
   * @name exportFormPdf
   */
  exportFormPdf: (params = {}) => {
    let domain = window.api.domain;
    let path = "/workflow/task/pdf";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["taskId"] !== undefined) {
      queryParameters["taskId"] = params["taskId"];
    }

    if (params["instanceId"] !== undefined) {
      queryParameters["instanceId"] = params["instanceId"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 查询下拉框数据
   * @method
   * @name getCategoryList
   */
  getSelectData: (params = {}) => {
    let domain = window.api.domain;
    let path = "";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["path"] !== undefined) {
      path = params["path"];
    }
    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 导出党员活动统计列表
   * @method
   * @name getPartyEventCountExport
   */
  getPartyEventCountExport: (params = {}) => {
    let domain = window.api.domain;
    let path = "/party/event/export";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["name"] !== undefined) {
      queryParameters["name"] = params["name"];
    }

    if (params["startTime"] !== undefined) {
      queryParameters["startTime"] = params["startTime"];
    }

    if (params["endTime"] !== undefined) {
      queryParameters["endTime"] = params["endTime"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 下载工作流实例表信息
   * @method
   * @name downloadWorkflowInstanceTableData
   */
  downloadWorkflowInstanceTableData: (params = {}) => {
    let domain = window.api.domain;
    let path = "/workflow/instance/table/data/download";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["body"] !== undefined) {
      body = params["body"];
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 下载汇总汇编表格信息
   * @method
   * @name downloadAssembly
   */
  downloadAssemblyWeb: (params = {}) => {
    let domain = window.api.domain;
    let path = "/assembly/web/{id}/download";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    path = path.replace("{id}", params["id"]);

    if (params["id"] === undefined) {
      return Promise.reject(new Error("Missing required  parameter: id"));
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 通过文件流上传文件,
   * @method
   * @name upDbLoadFileStream
   */
  upDbLoadFileStream: (params = {}, body = {}) => {
    let domain = window.api.domain;
    let path = "/sys/file/file/stream";
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["path"] !== undefined) {
      queryParameters["path"] = params["path"];
    }

    if (params["saveFileName"] !== undefined) {
      queryParameters["saveFileName"] = params["saveFileName"];
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers
    };
    options.headers["Content-Type"] = "application/octet-stream";

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 上传汇总汇编文件
   * @method
   * @name uploadAssemblyWebFile
   */
  uploadAssemblyWebFile: (params = {}) => {
    let domain = window.api.domain;
    let path = "/assembly/web/upload";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";
    headers["Content-Type"] = "multipart/form-data";

    if (params["file"] !== undefined) {
      form["file"] = params["file"];
    }

    if (params["path"] !== undefined) {
      queryParameters["path"] = params["path"];
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] = "application/octet-stream";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 根据查询条件导出信函列表
   * @method
   * @name getLetterExcel
   */
  getLetterExcel: (params = {}) => {
    let domain = window.api.domain;
    let path = "/letter/excel";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["pageIndex"] !== undefined) {
      queryParameters["pageIndex"] = params["pageIndex"];
    }

    if (params["pageSize"] !== undefined) {
      queryParameters["pageSize"] = params["pageSize"];
    }

    if (params["type"] !== undefined) {
      queryParameters["type"] = params["type"];
    }

    if (params["beginTime"] !== undefined) {
      queryParameters["beginTime"] = params["beginTime"];
    }

    if (params["endTime"] !== undefined) {
      queryParameters["endTime"] = params["endTime"];
    }

    if (params["organCommunication"] !== undefined) {
      queryParameters["organCommunication"] = params["organCommunication"];
    }

    if (params["originalNumber"] !== undefined) {
      queryParameters["originalNumber"] = params["originalNumber"];
    }

    if (params["title"] !== undefined) {
      queryParameters["title"] = params["title"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 信函返回pdf流文件并打印
   * @method
   * @name getLetterPdf
   */
  getLetterPdf: (params = {}) => {
    let domain = window.api.domain;
    let path = "/letter/pdf";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["ids"] !== undefined) {
      queryParameters["ids"] = params["ids"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },

  /**
   * 根据excel导入保存适配人员信息
   * @method
   * @name saveDisabledsExcel
   */
  saveDisabledsExcel: (params = {}, formData) => {
    let domain = window.api.domain;
    let path = "/bak/assist/activity/info/excel/{id}";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";
    headers["Content-Type"] = "multipart/form-data";

    path = path.replace("{id}", params["id"]);

    if (params["id"] === undefined) {
      return Promise.reject(new Error("Missing required  parameter: id"));
    }

    form = formData;

    if (params["fileTypes"] !== undefined) {
      queryParameters["fileTypes"] = params["fileTypes"];
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: form,
      headers: headers
    };

    return axios(options).then(ret => {
      return ret;
    });
  },

  /**
   * 根据活动id导出辅助器具申请列表
   * @method
   * @name exportApplyUserInfoById
   */
  exportApplyUserInfoById: (params = {}) => {
    let domain = window.api.domain;
    let path = "/bak/assist/equ/apply/info/excel/userList/{activityId}";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    path = path.replace("{activityId}", params["activityId"]);

    if (params["activityId"] === undefined) {
      return Promise.reject(
        new Error("Missing required  parameter: activityId")
      );
    }

    if (params["disabledTypeId"] !== undefined) {
      queryParameters["disabledTypeId"] = params["disabledTypeId"];
    }

    if (params["cid"] !== undefined) {
      queryParameters["cid"] = params["cid"];
    }

    if (params["userName"] !== undefined) {
      queryParameters["userName"] = params["userName"];
    }

    if (params["region"] !== undefined) {
      queryParameters["region"] = params["region"];
    }

    if (params["status"] !== undefined) {
      queryParameters["status"] = params["status"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 根据机构id导出机构管辖的儿童康复救助(申请)列表
   * @method
   * @name exportInstituteRecoveryListByInsId
   */
  exportInstituteRecoveryListByInsId: (params = {}) => {
    let domain = window.api.domain;
    let path = "/recovery/export/ins/{instituteId}";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["keywords"] !== undefined) {
      queryParameters["keywords"] = params["keywords"];
    }

    path = path.replace("{instituteId}", params["instituteId"]);

    if (params["instituteId"] === undefined) {
      return Promise.reject(
        new Error("Missing required  parameter: instituteId")
      );
    }

    if (params["startTime"] !== undefined) {
      queryParameters["startTime"] = params["startTime"];
    }

    if (params["endTime"] !== undefined) {
      queryParameters["endTime"] = params["endTime"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 查询残疾人信息列表——管理员用户导出
   * @method
   * @name exportDisabledPersonList
   */
  exportDisabledPersonList: (params = {}) => {
    let domain = window.api.domain;
    let path = "/disabled/person/export";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "application/json";

    if (params["name"] !== undefined) {
      queryParameters["name"] = params["name"];
    }

    if (params["type"] !== undefined) {
      queryParameters["type"] = params["type"];
    }

    if (params["level"] !== undefined) {
      queryParameters["level"] = params["level"];
    }

    if (params["startTime"] !== undefined) {
      queryParameters["startTime"] = params["startTime"];
    }

    if (params["endTime"] !== undefined) {
      queryParameters["endTime"] = params["endTime"];
    }

    if (params["region"] !== undefined) {
      queryParameters["region"] = params["region"];
    }

    let url = domain + path;
    let options = {
      method: "GET",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },

  /**
   * 残联驳回器具适配申请
   * @method
   * @name backApply
   */
  backApply: (params = {}) => {
    let domain = window.api.domain;
    let path = "/bak/assist/equ/apply/info/back/{applyId}";
    let body = {};
    let queryParameters = {};
    let headers = {};
    let form = {};

    headers["Accept"] = "*/*";
    headers["Content-Type"] = "application/json";

    path = path.replace("{applyId}", params["applyId"]);

    if (params["applyId"] === undefined) {
      return Promise.reject(new Error("Missing required  parameter: applyId"));
    }

    if (params["body"] !== undefined) {
      body = params["body"];
    }

    let url = domain + path;
    let options = {
      method: "POST",
      url: url,
      params: queryParameters,
      data: body,
      headers: headers
    };
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 导出当前问卷调查的调查结果
   * @method
   * @name exportQuestionnaire
   */
  exportQuestionnaire: (params = {}) => {

    let domain = window.api.domain
    let path = "/questionnaire/export"
    let body = {}
    let queryParameters = {}
    let headers = {}
    let form = {}

    headers["Accept"] = 'application/json'

    if (params["questionnaireId"] !== undefined) {
      queryParameters["questionnaireId"] = params["questionnaireId"]
    }

    let url = domain + path
    let options = {
      method: 'GET',
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    }
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
  /**
   * 导出所有残疾人享受的福利待遇列表
   * @method
   * @name exportDisabledPersonWealExcel
   */
  exportDisabledPersonWealExcel: (params = {}) => {

    let domain = window.api.domain
    let path = "/disabled/person/weal/export"
    let body = {}
    let queryParameters = {}
    let headers = {}
    let form = {}

    headers["Accept"] = 'application/json'

    if (params["keywords"] !== undefined) {
      queryParameters["keywords"] = params["keywords"]
    }

    if (params["type"] !== undefined) {
      queryParameters["type"] = params["type"]
    }

    if (params["year"] !== undefined) {
      queryParameters["year"] = params["year"]
    }

    let url = domain + path
    let options = {
      method: 'GET',
      url: url,
      params: queryParameters,
      data: body,
      headers: headers,
      responseType: "arraybuffer"
    }
    if (Object.keys(form).length > 0) {
      options.data = qs.stringify(form);
      options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'
    }

    return axios(options).then(ret => {
      return ret;
    });
  },
};
